﻿@{
    Layout = "";
}
@model ConfigurationModel
@using Nop.Plugin.Payments.PayPalDirect.Models;
@using Nop.Web.Framework;

@Html.Action("StoreScopeConfiguration", "Setting", new { area = "Admin" })

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-body">
                @T("Plugins.Payments.PayPalDirect.Instructions")
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.ClientId_OverrideForStore, model => model.ClientId, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.ClientId)
                    </div>
                    <div class="col-md-9">
                        @Html.NopEditorFor(model => model.ClientId)
                        @Html.ValidationMessageFor(model => model.ClientId)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.ClientSecret_OverrideForStore, model => model.ClientSecret, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.ClientSecret)
                    </div>
                    <div class="col-md-9">
                        @Html.NopEditorFor(model => model.ClientSecret)
                        @Html.ValidationMessageFor(model => model.ClientSecret)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.NopLabelFor(model => model.WebhookId)
                    </div>
                    <div class="col-md-9">
                        @if (Request.IsLocal)
                        {
                            @Html.NopEditorFor(model => model.WebhookId)
                        }
                        else
                        {
                            <div class="input-group">
                                @Html.NopEditorFor(model => model.WebhookId)
                                <div class="input-group-btn">
                                    <button type="submit" name="createwebhook" class="btn btn-info">
                                        @T("Plugins.Payments.PayPalDirect.WebhookCreate")
                                    </button>
                                </div>
                            </div>
                        }
                        @Html.ValidationMessageFor(model => model.WebhookId)
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.TransactModeId_OverrideForStore, model => model.TransactModeId, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.TransactModeValues)
                    </div>
                    <div class="col-md-9">
                        @Html.NopDropDownListFor(model => model.TransactModeId, Model.TransactModeValues)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.UseSandbox_OverrideForStore, model => model.UseSandbox, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.UseSandbox)
                    </div>
                    <div class="col-md-9">
                        @Html.NopEditorFor(model => model.UseSandbox)
                        @Html.ValidationMessageFor(model => model.UseSandbox)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.PassPurchasedItems_OverrideForStore, model => model.PassPurchasedItems, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.PassPurchasedItems)
                    </div>
                    <div class="col-md-9">
                        @Html.NopEditorFor(model => model.PassPurchasedItems)
                        @Html.ValidationMessageFor(model => model.PassPurchasedItems)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.AdditionalFee_OverrideForStore, model => model.AdditionalFee, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.AdditionalFee)
                    </div>
                    <div class="col-md-9">
                        @Html.NopEditorFor(model => model.AdditionalFee)
                        @Html.ValidationMessageFor(model => model.AdditionalFee)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        @Html.OverrideStoreCheckboxFor(model => model.AdditionalFeePercentage_OverrideForStore, model => model.AdditionalFeePercentage, Model.ActiveStoreScopeConfiguration)
                        @Html.NopLabelFor(model => model.AdditionalFeePercentage)
                    </div>
                    <div class="col-md-9">
                        @Html.NopEditorFor(model => model.AdditionalFeePercentage)
                        @Html.ValidationMessageFor(model => model.AdditionalFeePercentage)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-9 col-md-offset-3">
                        <input type="submit" name="save" class="btn btn-primary" value="@T("Admin.Common.Save")" />
                    </div>
                </div>
            </div>
        </div>
    </div>
}